<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查看平闰年</title>
</head>
<body>
    <input type="text" placeholder="请输入年份">
    <input type="button" value="查看">
</body>
<script>
    let inpArr = document.querySelectorAll('input')
    inpArr[1].onclick = ()=>{
        let year = inpArr[0].value
        year % 4 == 0 && year % 100 != 100 || year % 400 == 0 ? alert(`${year}是闰年`) : alert(`${year}不是闰年`)
    }
</script>
</html>